<template>
  <div>
    <div ref="title">哈赫尔</div>
  </div>
</template>

<script>
import { ref, watchEffect } from 'vue'
export default {
  setup() {
    const title = ref(null)
    watchEffect(() => {
      console.log(title.value)
    }, {
      // 如果想要只打印一次需要用到flush
      flush: 'post'
    })
    return {
      title
    }
  }
}
</script>

<style>

</style>